home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
windows
/
games
/
bjack1.exe
/
GLOBAL.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-11-19
|
37KB
|
855 lines
'********************* Wired On BlackJack ************************
'** **
'** **
'** This program is the client end of Wired On BlackJack. It **
'** provides the user interface and message processing **
'** for all client interaction. The high-level overview of the **
'** the program is contained in two conceptual modules. The **
'** of these is embodied in the Process_Messages() function in **
'** module1.bas. The second is the UI based on VB's form **
'** designing capabilities. **
'** **
'** Process_Messages receives, interprets, and acts upon **
'** messages received from the dealer. **
'** **
'** The UI obtains desired actions from the user, interprets **
'** them, and processes them. The processing of these messages **
'** may include sending messages to the dealer. Most of the UI **
'** is contained in FORM1.FRM. **
'** **
'** The communication vehicle with the dealer is a LAN MANAGER **
'** device known as Named Pipes. See procedures Open_Pipe, **
'** Close_Connection, Write_Packet, and Read_Packet to see **
'** how such pipes are accessed from VB. **
'** **
'** The program also used the VB Lan Manager Toolkit which **
'** provides high-level access to many LAN MANAGER functions **
'** in an easy to use fashion. See Get_Server and Get_Name **
'** for examples. **
'** **
'*****************************************************************
'*****************************************************************
'** Microsoft Visual Basic LAN Manager Toolkit **
'** Copyright(c) Microsoft Corp., 1991 **
'*****************************************************************
'********************************************************************
'* *
'* About this file ... NETCONS.TXT *
'* *
'* This file contains constants used throughout the LAN Manager *
'* API header files. It should be included in the global module *
'* of any Visual Basic program that is going to call a LAN Manager *
'* API. *
'* *
'********************************************************************
Global Const ASSUMEBLEN = 255 '* this constant is used for the
' record structure field with
' unknown size (mostly list of
' multiple information *
Global Const ASSUMESLEN = 50 '* this constant is used for the
' record structure field with
' unknown size (mostly single infor-
' mation *
Global Const CNLEN = 15 '* Computer name length *
Global Const CNLEN8 = (CNLEN + 1) * 8 - 1 '* Maximum 8 computer names *
' length separated by comma *
Global Const UNCLEN = CNLEN + 2 '* UNC computer name length *
Global Const NNLEN = 12 '* 8.3 Net name length *
Global Const RMLEN = UNCLEN + 1 + NNLEN '* Maximum remote name length *
Global Const SNLEN = 15 '* Service name length *
Global Const STXTLEN = 63 '* Service text length *
Global Const PATHLEN = 260
Global Const VBLMPATHLEN = PATHLEN - 1 '* VB pathlen without terminating NULL
Global Const PRINTERNAME_SIZE = 32 '* printer name
Global Const PRINTERNAME_SIZE10 = (PRINTERNAME_SIZE + 1) * 10 - 1
'* 10 printer names separated by commas
Global Const DRIV_NAME_SIZE = 8 '* device driver name
Global Const DRIV_NAME_SIZE10 = (DRIV_NAME_SIZE + 1) * 10 - 1
'* 10 device driver name w/ commas
Global Const DRIV_DEVICENAME_SIZE = 31 '* Device driver data string
Global Const DEVLEN = 8 '* Device name length *
Global Const DNLEN = CNLEN '* Maximum domain name length *
Global Const DNLEN10 = (DNLEN + 1) * 10 - 1 '* Maximum 10 domain names *
'* length separated by space *
Global Const CCHMAXPATHCOMP = 256 '* queue name
Global Const EVLEN = 16 '* event name length *
Global Const JOBSTLEN = 80 '* status length in print job *
Global Const AFLEN = 64 '* Maximum length of alert *
'* names field *
Global Const UNLEN = 20 '* Maximum user name length *
Global Const GNLEN = UNLEN '* Group name *
Global Const PWLEN = 14 '* Maximum password length *
Global Const SHPWLEN = 8 '* Share password length *
Global Const CLTYPE_LEN = 12 '* Length of client type string *
Global Const MAXCOMMENTSZ = 48 '* server & share comment length *
Global Const QNLEN = 12 '* Queue name maximum length *
Global Const PDLEN = 8 '* Print destination length *
Global Const PDLEN10 = (PDLEN + 1) * 10 - 1 '* max of 10 Print destination
' length separated by space *
Global Const DTLEN = 9 '* Spool file data type *
'* e.g. IBMQSTD,IBMQESC,IBMQRAW *
Global Const ALERTSZ = 128 '* size of alert string in server *
Global Const INTSIZE = 2
Global Const LONGSIZE = 4
Global Const SINGLESIZE = 4
Global Const DOUBLESIZE = 8
Global Const MAXDEVENTRIES = INTSIZE * 8 '* Max number of device entries *
'* We use int bitmap to represent *
Global Const HOURS_IN_WEEK = 168 '* for struct user_info_2 in UAS *
Global Const MAXWORKSTATIONS = 8 '* for struct user_info_2 in UAS *
Global Const NETBIOS_NAME_LEN = 16 '* NetBIOS net name *
'*
'* Constants used with encryption
'*
Global Const CRYPT_KEY_LEN = 7
Global Const CRYPT_TXT_LEN = 8
Global Const ENCRYPTED_PWLEN = 16
Global Const SESSION_PWLEN = 24
Global Const SESSION_CRYPT_KLEN = 21
'*
'* Value to be used with SetInfo calls to allow setting of all
'* settable parameters (parmnum zero option)
'*
'*
'* Message File Names
'*
Global Const MESSAGE_FILE = "NETPROG\\NET.MSG"
Global Const MESSAGE_FILENAME = "NET.MSG"
Global Const OS2MSG_FILE = "NETPROG\\OSO001.MSG"
Global Const OS2MSG_FILENAME = "OSO001.MSG"
Global Const HELP_MSG_FILE = "NETPROG\\NETH.MSG"
Global Const HELP_MSG_FILENAME = "NETH.MSG"
Global Const NMP_MSG_FILE = "NETPROG\\NMP.MSG"
Global Const NMP_MSG_FILENAME = "NMP.MSG"
Global Const MESSAGE_FILE_BASE = "NETPROG\\NET00000"
Global Const MESSAGE_FILE_EXT = ".MSG"
Global Const NMP_LOW_END = 230
Global Const NMP_HIGH_END = 240
Global Const NULL = 0
Global Const PUNAVAIL = NULL
Global Const ERROR_MORE_DATA = 234 '* Additional data is available. *
'*****************************************************************
'** Microsoft Visual Basic LAN Manager Toolkit **
'** Copyright(c) Microsoft Corp., 1991 **
'*****************************************************************
'********************************************************************
'* *
'* About this file ... VBLANMAN.TXT *
'* *
'* This file contains information about the VBLANMAN support DLL. *
'* *
'* Function prototypes. *
'* *
'* Definition of special values. *
'* *
'********************************************************************
'****************************************************************
'* *
'* Function prototypes - VBLANMAN.DLL *
'* *
'****************************************************************
Declare Function VBTypeToBuffer% Lib "vblanman.dll" (ByVal Dest&, ByVal DestLen%, Src As Any, ByVal SrcLen%, ByVal FormatString$)
Declare Function BufferToVBType% Lib "vblanman.dll" (Dest As Any, ByVal DestLen%, ByVal Src&, ByVal SrcLen%, ByVal FormatString$)
Declare Function EnumBufferToVBArray% Lib "vblanman.dll" (Dest As Any, ByVal DestLen%, ByVal Src&, ByVal SrcLen%, ByVal FormatString$, ByVal NumEnts%)
Declare Function CreateLMBuffer& Lib "vblanman.dll" (ByVal FormatString$, ByVal Entries%, BufferSize%)
Declare Function FreeLMBuffer% Lib "vblanman.dll" (ByVal BufferPointer&)
Declare Function CFormatSize% Lib "vblanman.dll" (ByVal FormatString$, ByVal Flag%)
Declare Function VBFormatSize% Lib "vblanman.dll" (ByVal FormatString$, ByVal Flag%)
Declare Function LMError$ Lib "vblanman.dll" Alias "LMError$" (ByVal ErrorCode%)
'****************************************************************
'* *
'* Special values and constants - VBLANMAN.DLL *
'* *
'****************************************************************
'*
'* Flag definitions for CFormatSize and VBFormatSize
'*
Global Const TOTAL_SIZE = 0 'Get total size (including var length strings)
Global Const FIXED_LEN_SIZE = 1 'Get fixed length size (no var length strings)
'*
'* Format strings for basic data types
'*
Global Const FMT_INTEGER = "I"
Global Const FMT_LONG = "L"
Global Const FMT_STRING = "S"
Global Const FMT_POINTER = "P"
'*****************************************************************
'** Microsoft Visual Basic LAN Manager Toolkit **
'** Copyright(c) Microsoft Corp., 1991 **
'*****************************************************************
'********************************************************************
'* *
'* About this file ... SERVER.TXT *
'* *
'* This file contains information about the NetServer APIs. *
'* *
'* Function prototypes. *
'* *
'* Data structure templates. *
'* *
'* Definition of special values. *
'* *
'* *
'* NOTE: You must include NETCONS.TXT before this file, since this*
'* file depends on values defined in NETCONS.TXT. *
'* *
'********************************************************************
'****************************************************************
'* *
'* Function prototypes *
'* *
'****************************************************************
Declare Function NetServerAdminCommand% Lib "NETAPI.DLL" (ByVal pszServer$, ByVal pszCommand$, psResult%, ByVal pszBuffer$, ByVal cbBuffer%, pcbReturned%, pcbTotalAvail%)
Declare Function NetServerDiskEnum% Lib "NETAPI.DLL" (ByVal pszServer$, ByVal sLevel%, ByVal pbBuffer&, ByVal cbBuffer%, pcEntriesRead%, pcTotalAvail%)
'pbBuffer will contain consecutive ASCIIZ strings indicating
'the list of disk drive names. There is currently no direct
'method for handling this type of buffer construct.
Declare Function NetServerEnum2% Lib "NETAPI.DLL" (ByVal pszServer$, ByVal sLevel%, ByVal pbBuffer&, ByVal cbBuffer%, pcEntriesRead%, pcTotalAvail%, ByVal flServerType&, ByVal pszDomain$)
Declare Function NetServerGetInfo% Lib "NETAPI.DLL" (ByVal pszServer$, ByVal sLevel%, ByVal pbBuffer&, ByVal cbBuffer%, pcbTotalAvail%)
Declare Function NetServerSetInfo% Lib "NETAPI.DLL" (ByVal pszServer$, ByVal sLevel%, ByVal pbBuffer&, ByVal cbBuffer%, ByVal sParmNum%)
'****************************************************************
'* *
'* Data structure templates *
'* *
'****************************************************************
Type server_info_0
sv0_name As String * CNLEN '* Server name *
End Type '* server_info_0 *
Global Const FMT_server_info_0 = "S15"
Type server_info_1
sv1_name As String * CNLEN
sv1_version_major As String * 1 '* Major version # of net *
sv1_version_minor As String * 1 '* Minor version # of net *
sv1_type As Long '* Server type *
sv1_comment As String
End Type '* server_info_1 *
Global Const FMT_server_info_1 = "S15B1B1LP48"
Type server_info_2
sv2_name As String * CNLEN
sv2_version_major As String * 1
sv2_version_minor As String * 1
sv2_type As Long
sv2_comment As String
sv2_ulist_mtime As Long'* User list, last modification time *
sv2_glist_mtime As Long '* Group list, last modification time *
sv2_alist_mtime As Long '* Access list, last modification time *
sv2_users As Integer '* max number of users allowed *
sv2_disc As Integer '* auto-disconnect timeout(in minutes) *
sv2_alerts As String '* alert names (semicolon separated)
sv2_security As Integer '* SV_USERSECURITY or SV_SHARESECURITY *
sv2_auditing As Integer '* 0 = no auditing; nonzero = auditing *
sv2_numadmin As Integer '* max number of administrators allowed *
sv2_lanmask As Integer '* bit mask representing the srv'd nets *
sv2_hidden As Integer '* 0 = visible; nonzero = hidden *
sv2_announce As Integer '* visible server announce rate (sec) *
sv2_anndelta As Integer '* announce randomize interval (sec) *
sv2_guestacct As String * UNLEN '* name of guest account *
sv2_pad1 As String * 1 '* Word alignment pad byte *
sv2_userpath As String '* ASCIIZ path to user directories*
sv2_chdevs As Integer '* max # shared character devices *
sv2_chdevq As Integer '* max # character device queues *
sv2_chdevjobs As Integer '* max # character device jobs *
sv2_connections As Integer '* max # of connections *
sv2_shares As Integer '* max # of shares *
sv2_openfiles As Integer '* max # of open files *
sv2_sessopens As Integer '* max # of open files per session *
sv2_sessvcs As Integer '* max # of virtual circuits per client *
sv2_sessreqs As Integer '* max # of simul. reqs. from a client *
sv2_opensearch As Integer '* max # of open searches *
sv2_activelocks As Integer '* max # of active file locks *
sv2_numreqbuf As Integer '* number of server (standard) buffers *
sv2_sizreqbuf As Integer '* size of svr (standard) bufs (bytes) *
sv2_numbigbuf As Integer '* number of big (64K) buffers *
sv2_numfiletasks As Integer'* number of file worker processes *
sv2_alertsched As Integer '* alert counting interval (minutes) *
sv2_erroralert As Integer '* error log alerting threshold *
sv2_logonalert As Integer '* logon violation alerting threshold *
sv2_accessalert As Integer '* access violation alerting threshold *
sv2_diskalert As Integer '* low disk space alert threshold (KB) *
sv2_netioalert As Integer '* net I/O error ratio alert threshold *
'* (tenths of a percent) *
sv2_maxauditsz As Integer '* Maximum audit file size (KB) *
sv2_srvheuristics As String '* performance related server switches*
End Type '* server_info_2 *
Global Const FMT_server_info_2 = "S15B1B1LP48LLLIIP255IIIIIIIS20B1P259IIIIIIIIIIIIIIIIIIIIIIP20"
Type server_info_3
sv3_name As String * CNLEN
sv3_version_major As String * 1
sv3_version_minor As String * 1
sv3_type As Long
sv3_comment As String
sv3_ulist_mtime As Long '* User list, last modification time *
sv3_glist_mtime As Long '* Group list, last modification time *
sv3_alist_mtime As Long '* Access list, last modification time *
sv3_users As Integer '* max number of users allowed *
sv3_disc As Integer '* auto-disconnect timeout(in minutes) *
sv3_alerts As String '* alert names (semicolon separated)
sv3_security As Integer '* SV_USERSECURITY or SV_SHARESECURITY *
sv3_auditing As Integer '* 0 = no auditing; nonzero = auditing *
sv3_numadmin As Integer '* max number of administrators allowed *
sv3_lanmask As Integer '* bit mask representing the srv'd nets *
sv3_hidden As Integer '* 0 = visible; nonzero = hidden *
sv3_announce As Integer '* visible server announce rate (sec) *
sv3_anndelta As Integer '* announce randomize interval (sec) *
sv3_guestacct As String * UNLEN '* name of guest account *
sv3_pad1 As String * 1 '* Word alignment pad byte *
sv3_userpath As String '* ASCIIZ path to user directories*
sv3_chdevs As Integer '* max # shared character devices *
sv3_chdevq As Integer '* max # character device queues *
sv3_chdevjobs As Integer '* max # character device jobs *
sv3_connections As Integer '* max # of connections *
sv3_shares As Integer '* max # of shares *
sv3_openfiles As Integer '* max # of open files *
sv3_sessopens As Integer '* max # of open files per session *
sv3_sessvcs As Integer '* max # of virtual circuits per client *
sv3_sessreqs As Integer '* max # of simul. reqs. from a client *
sv3_opensearch As Integer '* max # of open searches *
sv3_activelocks As Integer '* max # of active file locks *
sv3_numreqbuf As Integer '* number of server (standard) buffers *
sv3_sizreqbuf As Integer '* size of svr (standard) bufs (bytes) *
sv3_numbigbuf As Integer '* number of big (64K) buffers *
sv3_numfiletasks As Integer'* number of file worker processes *
sv3_alertsched As Integer '* alert counting interval (minutes) *
sv3_erroralert As Integer '* error log alerting threshold *
sv3_logonalert As Integer '* logon violation alerting threshold *
sv3_accessalert As Integer '* access violation alerting threshold *
sv3_diskalert As Integer '* low disk space alert threshold (KB) *
sv3_netioalert As Integer '* net I/O error ratio alert threshold *
'* (tenths of a percent) *
sv3_maxauditsz As Integer '* Maximum audit file size (KB) *
sv3_srvheuristics As String '* performance related server switches*
sv3_auditedevents As Long '* Audit event control mask *
sv3_autoprofile As Integer '* (0,1,2,3) = (NONE,LOAD,SAVE,or BOTH) *
sv3_autopath As String
'* file pathname (where to load & save) *
End Type '* server_info_3 *
'BUGBUG We don't know how long the alerts string is
Global Const FMT_server_info_3 = "S15B1B1LP48LLLIIP255IIIIIIIS20B1P259IIIIIIIIIIIIIIIIIIIIIIP20LIP259"
'****************************************************************
'* *
'* Special values and constants *
'* *
'****************************************************************
'*
'* Mask to be applied to svX_version_major in order to obtain
'* the major version number.
'*
Global Const MAJOR_VERSION_MASK = &HF
'*
'* Bit-mapped values for svX_type fields. X = 1, 2 or 3.
'*
Global Const SV_TYPE_WORKSTATION = &H1
Global Const SV_TYPE_SERVER = &H2
Global Const SV_TYPE_SQLSERVER = &H4
Global Const SV_TYPE_DOMAIN_CTRL = &H8
Global Const SV_TYPE_DOMAIN_BAKCTRL = &H10
Global Const SV_TYPE_TIME_SOURCE = &H20
Global Const SV_TYPE_AFP = &H40
Global Const SV_TYPE_NOVELL = &H80
Global Const SV_TYPE_ALL = &HFFFFFFFF '* handy for NetServerEnum2 *
'*
'* Special value for svX_disc that specifies infinite disconnect
'* time. X = 2 or 3.
'*
Global Const SV_NODISC = &HFFFF '* No autodisconnect timeout enforced *
'*
'* Values of svX_security field. X = 2 or 3.
'*
Global Const SV_USERSECURITY = 1
Global Const SV_SHARESECURITY = 0
'*
'* Values of svX_hidden field. X = 2 or 3.
'*
Global Const SV_HIDDEN = 1
Global Const SV_VISIBLE = 0
'*
'* Values for parmnum parameter to NetServerSetInfo.
'*
Global Const SV_COMMENT_PARMNUM = 5
Global Const SV_DISC_PARMNUM = 10
Global Const SV_ALERTS_PARMNUM = 11
Global Const SV_HIDDEN_PARMNUM = 16
Global Const SV_ANNOUNCE_PARMNUM = 17
Global Const SV_ANNDELTA_PARMNUM = 18
Global Const SV_ALERTSCHED_PARMNUM = 37
Global Const SV_ERRORALERT_PARMNUM = 38
Global Const SV_LOGONALERT_PARMNUM = 39
Global Const SV_ACCESSALERT_PARMNUM = 40
Global Const SV_DISKALERT_PARMNUM = 41
Global Const SV_NETIOALERT_PARMNUM = 42
Global Const SV_MAXAUDITSZ_PARMNUM = 43
Global Const SVI1_NUM_ELEMENTS = 5
Global Const SVI2_NUM_ELEMENTS = 44
Global Const SVI3_NUM_ELEMENTS = 45
'*
'* Maxmimum length for command string to NetServerAdminCommand.
'*
Global Const SV_MAX_CMD_LEN = VBLMPATHLEN
'*
'* Masks describing AUTOPROFILE parameters
'*
Global Const SW_AUTOPROF_LOAD_MASK = &H1
Global Const SW_AUTOPROF_SAVE_MASK = &H2
Global Const TRUE = -1
Global Const FALSE = 0
' These are action messages that the player can send to dealer.
' Messages can be sent to initiate an action or in response to
' a request received from the dealer. All messages are placed
' inside a PACKET structure before transmittal.
Global Const ACTN_CONNECT = 1
Global Const ACTN_PLAY_HAND = 2
Global Const ACTN_SURRENDER = 3
Global Const ACTN_SECURITY = 4
Global Const ACTN_STAY = 5
Global Const ACTN_DRAW = 6
Global Const ACTN_SPLIT = 7
Global Const ACTN_DOUBLE = 8
Global Const ACTN_TERMINATE = 9
Global Const ACTN_NO_RESPONSE = 10
Global Const ACTN_LOGOFF = 11
Global Const ACTN_BET = 12
Global Const ACTN_READY = 13
Global Const ACTN_CHEAT = 14
Global Const ACTN_SYNC = 15
' These are messages that may be received from the dealer.
' These messages appear in the Action field of a PACKET structure.
Global Const MSG_MAX_PLAYERS = 1
Global Const MSG_NOT_IN_HAND = 2
Global Const MSG_WANT_TO_PLAY = 4
Global Const MSG_YOUR_ID = 5
Global Const MSG_TABLE_FULL = 6
Global Const MSG_QUERY_BET = 7
Global Const MSG_WANT_SECURITY = 8
Global Const MSG_PLAYER_DATA = 9
Global Const MSG_DEALER_DATA = 10
Global Const MSG_QUERY_HS = 11
Global Const MSG_QUERY_HSD = 12
Global Const MSG_QUERY_HSDP = 13
Global Const MSG_OVER_21 = 14
Global Const MSG_BLACKJACK_PLAYER = 15
Global Const MSG_LOST_GAME = 16
Global Const MSG_WON_GAME = 17
Global Const MSG_DRAW_GAME = 18
Global Const MSG_BLACKJACK_DEALER = 19
Global Const MSG_WON_SECURITY = 20
Global Const MSG_LOST_SECURITY = 21
Global Const MSG_TERMINATE = 22
Global Const MSG_HAND_OVER = 23
Global Const MSG_CHEAT = 24
Global Const MSG_SPLIT = 25
Global Const MSG_DEALER_OVER_21 = 26
Global Const MSG_ON_LINE = 27
' The OFSTRUCT is used with Kernel's OpenFile function
Type OFSTRUCT
cBytes As String * 1
fFixedDisk As String * 1
nErrCode As Integer
reserved As String * 4
szPathName As String * 120
End Type
' The PACKET structure is the package in which all messages are transmitted
' between dealer and player. Looking at the dealer code will show a PACKET
' structure that is defined somewhat differently. The dealer uses a nested
' structure within PACKET to represent some fields, however, since this
' feature (nested structures) is not available in VB all fields have been
' placed 'in-line'.
' Furthermore, since VB does not allow an array within a structure the Cards
' field is created as a string of 30 bytes rather than an array of 15 integers.
' The string is interpreted differently than the array of integers would have
' been interpreted. The string contains a two ascii charachters to represent
' the corressponding number in the integer array. For example
' val(mid$(Cards,i*2+1,i*2+2)) is equal to the integer version of Cards[i].
Type PACKET
Action As Integer
IntValue1 As Integer
IntValue2 As Integer
Name As String * 20
hPipe As Integer
Cards As String * 30 'Why this? Because VB does not support arrays in user-types!!!
NumCards As Integer
CashOnHand As Integer
Bet As Integer
Security As Integer
State As Integer
BlackJack As Integer
Available As Integer
End Type
' size of the PACKET structure because VB does not support "sizeof()"
Global Const PACKET_SIZE = 72
' There can be a maximum of 28 players because there can be 7 physical players
' max at a blackjack table and this software allows a maximum of 4 splits per
' player. This is set to 27 because the array starts from 0.
Global Const MAX_PLAYERS = 28
' There can only be 8 players max, but we have to leave space in case
' each of them has split.
Global PlayerArray(0 To MAX_PLAYERS) As PACKET
' This is the pipe handle that is in use by the player. The pipe handle
' is used to determine the player's index in the PlayerArray
Global PipeHandle As Integer
' This is just a temporary string used in various modules to exchange
' string data with other modules
Global ServerString As String
'This instance's index in the PlayerArray array.
Global CurrentPlayerIndex As Integer
' This stores the player's name.
Global PlayerName As String * 20
' When this is 1 it means the currentplayer is being polled by the dealer
' The client should send a guaranteed response to the dealer in the
' event of OnLine being 1. This will allow the dealer to realize that
' there is no message from this client and move onto the next client.
Global OnLine As Integer
' This is the identifier of the card deck that is being used.
Global DeckId As Integer
' This variable contains the id code of the player who is currently
' making a decision. May or may not be the CurrentPlayerIndex
Global DecidingPlayerIndex As Integer
' The default bet amount
Global DefaultBet As String
' This is when it is not any player's turn
Global Const NO_PLAYER = -10
' The width of each player's drawing region.
Global Const PLAYER_REGION_WIDTH = 150
' Controls the BetBox and BetScrollBar objects to allow spin control emulation
Global Const PASSTHRU = "PASSTHRU"
Global Const NOPASSTHRU = "NOPASSTHRU"
' This tracks the current phase in which the client is operating
Global GamePhase As Integer
Global Const PHASE_WANT_TO_PLAY = 1
Global Const PHASE_QUERY_BET_ONE = 2
Global Const PHASE_QUERY_BET_TWO = 3
Global Const PHASE_QUERY_SECURITY = 4
Global Const PHASE_MAKE_DECISIONS = 5
' Random chance of a sound being played (if Multimedia Windows is installed)
Global Const RANDOM_SOUND = .15
Declare Function OpenFile% Lib "Kernel" (ByVal FileName As String, FileData As OFSTRUCT, ByVal mode As Integer)
Declare Function FileRead% Lib "Kernel" Alias "_lread" (ByVal FileHandle As Integer, Buffer As Any, ByVal ToRead As Integer)
Declare Function FileClose% Lib "Kernel" Alias "_lclose" (ByVal FileHandle As Integer)
Declare Function FileWrite% Lib "Kernel" Alias "_lwrite" (ByVal FileHandle As Integer, Buffer As Any, ByVal ToWrite As Integer)
Declare Function FileSeek% Lib "Kernel" Alias "_llseek" (ByVal FileHandle As Integer, ByVal Offset As Long, ByVal Origin As Integer)
Declare Function DosPeekNmPipe% Lib "NETAPI.DLL" (ByVal Handle%, Buffer As Any, ByVal BufLen%, bRead%, bAvail%, Status%)
' CARDS.DLL Declarations
'
Declare Function cdtDraw% Lib "cards.dll" (ByVal hdc%, ByVal x%, ByVal y%, ByVal cd%, ByVal mode%, ByVal rgbBgnd&)
Declare Function cdtInit% Lib "cards.dll" (pdxCard%, pdyCard%)
Declare Function cdtDrawExt% Lib "cards.dll" (ByVal hdc%, ByVal x%, ByVal y%, ByVal dx%, ByVal dy%, ByVal cd%, ByVal mode%, ByVal rgbBgnd&)
'
' Sound API from Multimedia Windows
'
Global Const SND_SYNC = 0
Declare Function SndPlaySound Lib "mmsystem.dll" (ByVal FileName As String, ByVal Flags As Integer) As Integer
' Name of blackjack server
Global Server As String
'*****************************************************************
'** Microsoft Visual Basic LAN Manager Toolkit **
'** Copyright(c) Microsoft Corp., 1991 **
'*****************************************************************
'********************************************************************
'* *
'* About this file ... WKSTA.TXT *
'* *
'* This file contains information about the NetWksta APIs. *
'* *
'* Function prototypes. *
'* *
'* Data structure templates. *
'* *
'* Definition of special values. *
'* *
'* *
'* NOTE: You must include NETCONS.TXT before this file, since this*
'* file depends on values defined in NETCONS.TXT. *
'* *
'********************************************************************
'****************************************************************
'* *
'* Function prototypes *
'* *
'****************************************************************
Declare Function NetWkstaGetInfo% Lib "NETAPI.DLL" (ByVal pszServer$, ByVal sLevel%, ByVal pbBuffer&, ByVal cbBuffer%, pcbTotalAvail%)
Declare Function NetWkstaSetInfo% Lib "NETAPI.DLL" (ByVal pszServer$, ByVal sLevel%, ByVal pbBuffer&, ByVal cbBuffer%, ByVal sParmNum%)
Declare Function NetWkstaSetUID2% Lib "NETAPI.DLL" (ByVal pszReserved$, ByVal pszDomain$, ByVal pszUserName$, ByVal pszPassword$, ByVal pszParms$, ByVal usLogoffForce%, ByVal sLevel%, ByVal pbBuffer&, ByVal cbBuffer%, pcbTotalAvail%)
'****************************************************************
'* *
'* Data structure templates *
'* *
'****************************************************************
Type wksta_info_0
wki0_reserved_1 As Integer
wki0_reserved_2 As Long
wki0_root As String
wki0_computername As String
wki0_username As String
wki0_langroup As String
wki0_ver_major As String * 1
wki0_ver_minor As String * 1
wki0_reserved_3 As Long
wki0_charwait As Integer
wki0_chartime As Long
wki0_charcount As Integer
wki0_reserved_4 As Integer
wki0_reserved_5 As Integer
wki0_keepconn As Integer
wki0_keepsearch As Integer
wki0_maxthreads As Integer
wki0_maxcmds As Integer
wki0_reserved_6 As Integer
wki0_numworkbuf As Integer
wki0_sizworkbuf As Integer
wki0_maxwrkcache As Integer
wki0_sesstimeout As Integer
wki0_sizerror As Integer
wki0_numalerts As Integer
wki0_numservices As Integer
wki0_errlogsz As Integer
wki0_printbuftime As Integer
wki0_numcharbuf As Integer
wki0_sizcharbuf As Integer
wki0_logon_server As String
wki0_wrkheuristics As String
wki0_mailslots As Integer
End Type '* wksta_info_0 *
Global Const FMT_wksta_info_0 = "ILP259P15P20P15B1B1LILIIIIIIIIIIIIIIIIIIIP15P55I"
Type wksta_info_1
wki1_reserved_1 As Integer
wki1_reserved_2 As Long
wki1_root As String
wki1_computername As String
wki1_username As String
wki1_langroup As String
wki1_ver_major As String * 1
wki1_ver_minor As String * 1
wki1_reserved_3 As Long
wki1_charwait As Integer
wki1_chartime As Long
wki1_charcount As Integer
wki1_reserved_4 As Integer
wki1_reserved_5 As Integer
wki1_keepconn As Integer
wki1_keepsearch As Integer
wki1_maxthreads As Integer
wki1_maxcmds As Integer
wki1_reserved_6 As Integer
wki1_numworkbuf As Integer
wki1_sizworkbuf As Integer
wki1_maxwrkcache As Integer
wki1_sesstimeout As Integer
wki1_sizerror As Integer
wki1_numalerts As Integer
wki1_numservices As Integer
wki1_errlogsz As Integer
wki1_printbuftime As Integer
wki1_numcharbuf As Integer
wki1_sizcharbuf As Integer
wki1_logon_server As String
wki1_wrkheuristics As String
wki1_mailslots As Integer
wki1_logon_domain As String
wki1_oth_domains As String
wki1_numdgrambuf As Integer
End Type '* wksta_info_1 *
'BUGBUG don't know how long oth_domains may be
Global Const FMT_wksta_info_1 = "ILP259P15P20P15B1B1LILIIIIIIIIIIIIIIIIIIIP15P55IP15P159I"
Type wksta_info_10
wki10_computername As String
wki10_username As String
wki10_langroup As String
wki10_ver_major As String * 1
wki10_ver_minor As String * 1
wki10_logon_domain As String
wki10_oth_domains As String
End Type '* wksta_info_10 *
Global Const FMT_wksta_info_10 = "P15P20P15B1B1P15P159"
'****************************************************************
'* *
'* Special values and constants *
'* *
'****************************************************************
'*
'* Constants for use as NetWkstaSetInfo parmnum parameter
'*
Global Const WKSTA_CHARWAIT_PARMNUM = 10
Global Const WKSTA_CHARTIME_PARMNUM = 11
Global Const WKSTA_CHARCOUNT_PARMNUM = 12
Global Const WKSTA_ERRLOGSZ_PARMNUM = 27
Global Const WKSTA_PRINTBUFTIME_PARMNUM = 28
Global Const WKSTA_WRKHEURISTICS_PARMNUM = 32
Global Const WKSTA_OTHDOMAINS_PARMNUM = 35
'*
'* Definitions for NetWkstaSetUID's ucond parameter
'*
Global Const WKSTA_NOFORCE = 0
Global Const WKSTA_FORCE = 1
Global Const WKSTA_LOTS_OF_FORCE = 2
Global Const WKSTA_MAX_FORCE = 3
'*
'* Maximum number of additional domains
'*
Global Const MAX_OTH_DOMAINS = 4
' Constants and declarations for the about dialog
Declare Function GetDeviceCaps% Lib "GDI" (ByVal hdc%, ByVal index%)
Declare Function GetSystemMenu% Lib "User" (ByVal hwnd%, ByVal bRevert%)
Declare Function RemoveMenu% Lib "User" (ByVal hMenu%, ByVal nPosition%, ByVal wFlags%)
Global Const NUMCOLORS = 24 ' used in GetDeviceCaps function